function [Paths] = getDataSetPath(Date,DataSetNums,BoolProcessed)
%[Paths] = getDataSetPath(Date,DataSetNums)
%Returns full path for data set.
%DataSetNums is a 1D array. If it is a single number, then Paths is a char.
%If it is longer, Paths is a cell array of paths.
%If BoolProcessed is 1, this function returns the path to the processed
%subfolder of the data set. Otherwise, it simply returns the data set
%folder.
%To get a date, Date = datenum(2016,2,1); e.g. for yyyy,mm,dd.

%InitPath = pwd;
%RootImageDirectory = '\\128.112.86.75\lithium\IMAGING DATA';
RootImageDirectory = fullfile('//','128.112.86.75','lithium','IMAGING DATA');
DateStr = fullfile(datestr(Date,'yyyy'),datestr(Date,'mm'),datestr(Date,'dd'));
%DateStr = datestr(Date,'yyyy/mm/dd');

if ~exist('BoolProcessed','var')
    BoolProcessed = 0;
end

% if length(Month) == 1
%     Month = strcat('0',Month);
% end
% 
% if length(Day) == 1
%     Day = strcat('0',Day');
% end
Paths = {};
for ii = 1:length(DataSetNums)
    DataSetNum = DataSetNums(ii);
    DatePath = fullfile(RootImageDirectory,DateStr);
    %cd(DatePath)
    if (DataSetNum>0)&&(DataSetNum<10)
        DirPath = fullfile(DatePath,strcat('00',num2str(DataSetNum),'_*'));
        DataFile = dir(DirPath);
        %DataFile = dir(cat(2,'00',num2str(DataSetNum),'_*'));
    elseif (DataSetNum>9)&&(DataSetNum<100)
        DirPath = fullfile(DatePath,strcat('0',num2str(DataSetNum),'_*'));
        DataFile = dir(DirPath);
        %DataFile = dir(cat(2,'0',num2str(DataSetNum),'_*'));
    end

    if isempty(DataFile)
        disp('No Such Dataset')
        Path = '';
    elseif length(DataFile)>1
        disp('More than one such directory')
        Path = '';
    else
        if BoolProcessed
            Path = fullfile(DatePath,DataFile.name,'processed');
        else
            Path = fullfile(DatePath,DataFile.name);
        end
    end
    Paths = cat(2,Paths,Path);
end

if length(Paths)<=1
    Paths = char(Paths);
end

%cd(InitPath)

%check for dataset number prefix, and return path to that folder...
end

